define(["config","jquery", "layer", "cookie", "./lib/bootstrap", "datetimepicker", "uploadImage", "edit","selectmodel"], function (config, $, layer, cookie, bootstrap, datetimepicker, uploadImage, edit, selectmodel) {
    return function () {
        uploadImage();
        var content = edit({
            elm:'#content',
        })
        $(".btn-save").click(function(){
            var index = layer.confirm('是否确定', {
                btn: ['是','返回']
            }, function(){
                content.next('.note-editor').find('.note-codable').attr('name','content').html(content.next('.note-editor').find('.note-editable').html());
                $.ajax({
                    url:"",
                    async: true,
                    type:"get",
                    data:$(".formSave").serialize(),
                    dataType:"json",
                    success: function(d){
                        if(d.state){
                            layer.alert("操作成功");
                            setTimeout(function(){
                                location.href = 'index.html';
                            },500)
                        }else{
                            layer.alert(d.msg);
                        }
                    }
                })
            });
        })
    }
})